$(function(){
    showCondition(true, 1, 1, 1, []);
    var totalCaseCnt;
    var drgCode = '';
    var isFirst = true;
    var barColor = ["#50a1d4","#f07043","#7bd9a5","#d0648a","#f58db2","#f2b3c9"];

    //全院总体指标
    var totalQuota = [
        ['InCaseCnt', '病例数'],
        ['FeeEff', '费用消耗指数'],
        ['AvgFee', '次均费用'],
        ['AvgDays', '平均住院日'],
        ['AvgDrugFee', '次均药品费用(元)'],
        ['DrugRatio', '药品费用占比(%)'],
        ['AvgMateFee', '次均耗材费用(元)'],
        ['MaterialRatio', '耗材费用占比(%)'],
        ['MedFee', '医疗费'],
        ['NursFee', '护理费'],
        ['ManageFee', '管理费'],
        ['TechFee', '医技费'],
        ['DrugMaterFee', '药品耗材费']
    ];

    //获取指标值
    function getQuotaValue(quotaCode, monitorType, callback,drgCode){
        var param=drgUI.setAjaxData(tabId);
        param.monitorType=monitorType;
        if (drgCode) {
            param.pardrgCode = drgCode;
        }
        param.quotaCode=quotaCode;

        $.post(contextPath + "/DrgsIndexCal/indexCal.dhc", param).done(function(data) {
            if(data.success){
                if(data.data.length>0){
                    data = data.data;
                    callback(data);
                }
            }
        });
    }

    //获取指标值所有比较值
    function getQuotaValueAllCompare(quotaCode, monitorType, callback,drgCode){
        var param=drgUI.setAjaxData(tabId);
        param.monitorType=monitorType;
        if (drgCode) {
            param.pardrgCode = drgCode;
        }
        param.quotaCode=quotaCode;

        $.post(contextPath + "/DrgsIndexCal/indexCalAllCompareType.dhc", param).done(function(data) {
            if(data.success){
                if(data.data.length>0){
                    data = data.data;
                    callback(data);
                }
            }
        });
    }

    //获取整体情况
    getQuotaValue('TotalFee,TotalCaseCnt', 'dep', function(result){
        totalCaseCnt = result[0].TotalCaseCnt;
    });

    $("#benchmarkSlider1").ionRangeSlider({
        min: 0,
        max: 99,
        step: 1,
        postfix: '%',
        grid: true,
        onFinish: function(){
            overFeeCaseShow(drgCode,1);
        }
    });
    $("#benchmarkSlider2").ionRangeSlider({
        min: 0,
        max: 5,
        step: 0.1,
        grid: true,
        onFinish: function(){
            overFeeCaseShow(drgCode,2);
        }
    });

    //查询病组次均费用、费用构成及其对比情况表
    function queryDRGQuota(){
        var quotaCode = totalQuota.map(function(v){return v[0]}).join(',');
        quotaCode +=',TotalCaseCnt,FeeEff,ExcessCnt_F';
        var columns=[
            {
                "className":      'details-control',
                "orderable":      false,
                "data":           null,
                "defaultContent": '',
                width: 20
            },
            {"data": "drg","title":'DRG',
                "render": function(obj, type, full) {
                    return '<span data-toggle="tooltip" data-placement="right" title="'+full.DDESC+'">'+full.CCODE+'</span>';
                }
            }
        ];

        //根据页面选择的指标，动态拼接表头
        for (var i = 0; i < totalQuota.length; i++) {
            var q = totalQuota[i];
            //for (var q of totalQuota) {
            (function(q){
                q[0] = q[0].toUpperCase();
                columns.push({"data": q[0],"title":q[1],
                    "render": function(obj, type, full) {
                        //return formatNumber(full.TotalCaseCnt*100/totalCaseCnt,2);
                        if (full[q[0]] > full[q[0]+'CC']){
                            return '<span class="text-danger" title="超标">'+full[q[0]]+'</span>';
                        } else {
                            return '<span>'+full[q[0]]+'</span>';

                        }
                    }
                });
            }(q));
        }
        var paramsDataTables={
            searching:true,
            lengthChange:true,
            ordering:true,
            info:false,
            // scrollX:true,
            // scrollY:'285px',
            orderCellsTop:true,
            order: [[3, 'desc']]
        };

        var param=drgUI.setAjaxData(tabId);
        param.typeFour='1'; //1表示从费用构成及对比点击进来的，2表示从区间分布点击进来的
        param.compareObj='AvgFee'; //超标病例的指标项
        //次均费用、费用构成及其对比情况表数据获取
        $.post(contextPath + "/feeAnalysisDep/getDrgCompareData.dhc", param).done(function(data) {
            if(data.success){
                if(data.data.length>0){
                    var data=data.data;
                    renderFeeStrucTable(data);
                }
            }
        });

        //year: 同比
        //month: 环比
        //hosp: 院内均值
        //getQuotaValue(quotaCode, 'drgs', function (data) {
        function renderFeeStrucTable(data){
            drgCode = data[0].CCODE;
            overFeeCaseShow(drgCode,1);
            overFeeCaseShow(drgCode,2);
            var table = $("#drgFeeTable").dataTableBasic(columns,data,paramsDataTables);
            $('[data-toggle="tooltip"]').tooltip();

            //展开某病组的费用信息
            $('#drgFeeTable tbody').on('click', 'td.details-control', function () {
                var tr = $(this).closest('tr');
                var row = table.row( tr );

                if ( row.child.isShown() ) {
                    row.child.hide();
                    tr.removeClass('shown');
                } else {
                    drgCode = row.data().CCODE;
                    overFeeCaseShow(drgCode,1);
                    overFeeCaseShow(drgCode,2);
                    row.child('<div class="col-sm-6" id="feeCompChart'+drgCode+'" style="height:280px;"></div>' +
                        '<div class="col-sm-6" id="feeStackChart'+drgCode+'" style="height:280px;"></div>' +
                        '<div class="col-sm-12"><table class="table" id="feeCompTable'+drgCode+'" style="width: 100%;"><caption><h5>'+drgCode+'-'+row.data().DDESC+'病组次均费用、费用构成及其对比情况表</h5></caption></table></div>').show();
                    tr.addClass('shown');

                    //请求数据
                    var quota = [
                        ['MedFee', '医疗费'],
                        ['NursFee', '护理费'],
                        ['ManageFee', '管理费'],
                        ['TechFee', '医技费'],
                        ['DrugMaterFee', '药品耗材费']
                    ];
                    var otherFeeQuota = [
                        ['AvgFee', '次均费用'],
                        ['AvgDays','平均住院日'],
                        ['AvgDrugFee', '次均药品费用'],
                        ['DrugRatio', '药品费用占比'],
                        ['AvgMateFee', '次均耗材费用'],
                        ['MaterialRatio', '耗材费用占比']
                    ];

                    //病组展开的 次均费用、费用构成及其对比情况表
                    var paramA=drgUI.setAjaxData(tabId);
                    paramA.pardrgCode=drgCode;
                    var pargroupName=paramA.pargroupName; //主诊组点击进来的
                    $.post(contextPath + "/feeAnalysisDep/getDrgFeeCompareTable.dhc", paramA).done(function(data) {
                        if(data.success){
                            if(data.data.length>0){
                                var data=data.data;
                                //如果是科室病组点击进来的，将平均值（本科室该DRG病组）的行数据删除掉
                                if(pargroupName==""||pargroupName==null||pargroupName==undefined){
                                    for(var i in data){
                                        var code=data[i].CCODE;
                                        if(code=="avgdep"){
                                            data.splice(i,1);
                                            break;
                                        }
                                    }
                                }
                                renderDRGDetail(data)
                            }
                        }
                    });
                    //getQuotaValueAllCompare(quota.map(v{return v[0]).join(',')+','+otherFeeQuota.map(v{return v[0]).join(',')+','+'TotalFee', 'drgs', function (data) {
                    function renderDRGDetail(data){
                        var seriesData = [{
                            name:'总费用',
                            type:'bar',
                            //data: data.map(v{return v.MedFeecc+v.NursFeecc+v.ManageFeecc+v.TechFeecc+(v.DrugMaterFeecc||0))
                            data: data.map(function(v){return v.MEDFEE+v.NURSFEE+v.MANAGEFEE+v.TECHFEE+(v.DRUGMATERFEE||0)})
                        }];
                        for (var i = 0; i < quota.length; i++) {
                            var q = quota[i];
                            //for (var q of quota) {
                            (function(q){
                                q[0] = q[0].toUpperCase();
                                seriesData.push({
                                    name: q[1],
                                    type:'bar',
                                    stack: '五大类费用',
                                    data:data.map(function(v){return v[q[0]]})
                                });
                            }(q));
                        }
                        drawBarChart('feeCompChart'+drgCode, drgCode+'病组次均费用对比图', quota.map(function(v){return v[1]}), data.map(function(v){return v.DDESC}), seriesData);


                        var seriesDataStack = [];
                        for (var i = 0; i < quota.length; i++) {
                            var q1 = quota[i];
                            //for (var q1 of quota) {
                            (function(q){
                                q[0] = q[0].toUpperCase();
                                seriesDataStack.push({
                                    name: q[1],
                                    type:'bar',
                                    stack: '五大类费用',
                                    data: data.map(function(v){return v[q[0]]})
                                });
                            }(q1));
                        }
                        drawBarChart('feeStackChart'+drgCode, drgCode+'病组费用构成及其对比图', quota.map(function(v){return v[1]}), data.map(function(v){return v.DDESC}), seriesDataStack);


                        //表格
                        var columns=[
                            {"data": "DDESC","title":'比较对象'}
                        ];
                        //拼接表头
                        for (var i = 0; i < otherFeeQuota.concat(quota).length; i++) {
                            var q = otherFeeQuota.concat(quota)[i];
                            //for (var q of otherFeeQuota.concat(quota)) {
                            (function(q){
                                q[0] = q[0].toUpperCase();
                                columns.push({"data": q[0],"title":q[1]});
                            }(q));
                        }
                        $('#feeCompTable'+row.data().CCODE).dataTableBasic(columns,data,{dom: '<"top">t<"bottom"><"clear">'});

                    }
                }
            });

            //按入组病例数倒序
            data.sort(function(a, b){
                return b.INCASECNT - a.INCASECNT;
            });

            var caseBarChartOption = {
                title: {
                    text: '病例数最多的10个DRG病组',
                    textStyle: {
                        fontSize: 14
                    }
                },
                tooltip: {
                    trigger: 'axis',
                    position: 'right'
                },
                legend: {
                    data:['超标病例数', '未超标病例数']
                },
                color: barColor,
                xAxis: {
                    type: 'category',
                    data: data.filter(function(v,i){return i<10}).map(function(v){return v.CCODE+'-'+v.DDESC}),
                    axisLabel: {
                        formatter: function(v){
                            return v.substr(0,4);
                        }
                    }
                },
                yAxis: {
                    type: 'value'
                },
                series: [{
                    name: '未超标病例数',
                    stack: '病例数',
                    data: data.filter(function(v,i){return i<10}).map(function(v){return v.INCASECNT-v.EXCESSCNT_F}),//ExcessCnt_F),
                    type: 'bar'
                },{
                    name: '超标病例数',
                    stack: '病例数',
                    data: data.filter(function(v,i){return i<10}).map(function(v){return v.EXCESSCNT_F}),//ExcessCnt_F),
                    type: 'bar'
                }]
            };
            var caseBarChart = echarts.init(document.getElementById('caseBarChart'));
            caseBarChart.setOption(caseBarChartOption);

            //截取前十
            var top10Array = data.filter(function(v){return v.EXCESSCNT_F>0}).filter(function(v,i){return i<10}).map(function(v){
                return {
                    value: v.EXCESSCNT_F,
                    name: v.CCODE+'-'+v.DDESC
                }
            });
            //除前十外的归为其他
            var otherArray = data.filter(function(v){return v.EXCESSCNT_F>0}).filter(function(v,i){return i>10}).map(function(v){
                return Number(v.EXCESSCNT_F);
            })
            if (otherArray.length>0) {
                var otherArrayTotal = otherArray.reduce(function(s,v){
                    return s+v;//求和
                });
                top10Array.push({name: '其他', value: otherArrayTotal});
            }

            var casePieChartOption = {
                title: {
                    text: 'DRG病组内超标病例数分布图',
                    textStyle: {
                        fontSize: 14
                    }
                },
                tooltip: {
                    trigger: 'item',
                    formatter: "{b}<br/> {c} ({d}%)"
                },
                color: barColor,
                series: [{
                    name: '超标病例数',
                    selectedMode: 'single',
                    radius: [0, '50%'],
                    label: {
                        normal: {
                            formatter: function(param){
                                return param.name.substr(0,4)+' : '+param.value+'例 ('+param.percent.toFixed(1)+'%)';
                            },
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            fontSize: 16,
                            lineHeight: 33,
                            padding: [4, 6],
                            borderRadius: 2
                        }
                    },
                    data: top10Array,
                    type: 'pie'
                }]
            };
            var casePieChart = echarts.init(document.getElementById('casePieChart'));
            casePieChart.setOption(casePieChartOption);
        }

    }

    //拼接html
    function feeRatio(data, quotaCode, cc){
        cc = cc || '';
        return (data[quotaCode]/100/data['TotalFee'+cc]).toFixed(0);
    }

    queryDRGQuota();

    function drawBarChart(id, title, legend, category, seriesData){
        var option = {
            title: {
                text: title,
                textStyle: {
                    fontSize: 15
                }
            },
            grid: {
                left: 170
            },
            tooltip : {
                trigger: 'axis',
                position: [0,20],
                axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                    type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            legend: {
                top: 20,
                data: legend
            },
            yAxis : [
                {
                    type : 'category',
                    data : category
                }
            ],
            xAxis : [
                {
                    type : 'value'
                }
            ],
            series : seriesData
        };

        var chart = echarts.init(document.getElementById(id));
        chart.setOption(option);
    }

    //区间划分
    function overFeeCaseShow(drgCode,calType){
        var sliderValBench = $('#benchmarkSlider'+calType).val();
        var param=drgUI.setAjaxData(tabId);
        if (drgCode) {
            param.pardrgCode = drgCode;
        }

        param.type1 = calType; //划分类型 1是标杆法区间划分 2是标差法区间划分
        if (calType === 1) {
            param.type2 = 1+sliderValBench/100; //超标比例
        } else {
            param.type2 = sliderValBench; //超标比例
        }

        $.post(contextPath + "/feeAnalysisDep/getDRGOverFeeCaseShow.dhc", param).done(function(res){
            var data=res.data;
            //加载费用变化趋势图
            loadDRGOverFeeCase(data,sliderValBench,drgCode,calType);
        });
    }

    //加载不同特征区间内病例分布情况
    //calType: 计算类型，1:标杆区间法，2:标准差区间法
    function loadDRGOverFeeCase(data,sliderValBench,drgCode,calType){
        //饼图
        var feeEchartData = data.filter(function (v) {return v.ccode!=='all'}).map(function(v){
            return {
                name : v.ddesc,
                value : v.CASECNT
            };
        });
        pieCharts($("#"+tabId+" #caseFeeRangChart"+calType),feeEchartData ,"指标超标病例分布图",drgCode+'病组下病例区间分布图');

        //填充columns
        var columns=[
            {"data": "ddesc","title":"区间内病例类型"},
            {"data": "RANGE","title":"费用区间范围",
                "render": function(obj, type, full) {
                    return '['+formatNumber(full.MINVALUE,2)+', '+ formatNumber(full.MAXVALUE,2)+']';
                }
            },
            {"data": "CASECNT","title":"病例数",
                "render": function(obj, type, full,meta) {
                    if(full.CASECNT==0){
                        return 0 ;
                    }else{
                        var abnomalType; //全部病例 all 未超标 not 超标N以内病例 in 超标N及以上病例 more
                        if(meta.row==0){
                            abnomalType="all";
                        }else if(meta.row==1){
                            abnomalType="more";
                        }else if(meta.row==2){
                            abnomalType="in";
                        }else {
                            abnomalType="not";
                        }
                        return '<a href="javascript:loadFeeDRGCase(\''+sliderValBench+'\',\''+calType+'\',\''+abnomalType+'\',\''+drgCode+'\',\''+full.ddesc+'\')">'+formatNumber(full.CASECNT,0)+'</a>';
                    }
                }
            },
            {"data": "CASERATION","title":"病例数占比（%）",
                "render": function(obj, type, full) {
                    return formatNumber(full.CASECNT*100/data[0].CASECNT,2) ;
                }
            },
            {"data": "AVGFEE","title":"次均费用"},
            {"data": "STDFEE","title":"次均费用标杆"},
            {"data": "AVGDAYS","title":"平均住院日"}
            // ,
            // {"data": "OPER","title":"操作",
            //     "render": function(obj, type, full,meta) {
            //         var str = "";
            //         str = "<a class = 'costStructure' data-rowindex='"+meta.row+"'>主诊组</a>" ;
            //         return str;
            //     }
            // }
        ];
        var paramsDataTables={searching:false,lengthChange:false,ordering:false,stateSave:true,info:false,paging:false,dom: '<"top">t<"bottom"><"clear">'};
        $("#"+tabId+" #caseFeeRangTable"+calType).dataTableBasic(columns,data,paramsDataTables);

        var fiveAvgFee = [
            ['MEDFEE', '医疗费'],
            ['NURSFEE', '护理费'],
            ['MANAGEFEE', '管理费'],
            ['TECHFEE', '医技费'],
            ['DRUGMATERFEE', '药品耗材费']
        ]
        //费用分类对比条形图
        var seriesData = [{
            name:'总费用',
            type:'bar',
            data: data.map(function(v){return v.AVGMEDFEE+v.AVGNURSFEE+v.AVGMANAGEFEE+v.AVGTECHFEE+v.AVGDRUGMATERFEE})
        }];
        for (var i = 0; i < fiveAvgFee.length; i++) {
            var q = fiveAvgFee[i];
            //for (var q of fiveAvgFee) {
            (function(q){
                seriesData.push({
                    name: q[1],
                    type:'bar',
                    stack: '五大类费用',
                    data:data.map(function(v){return v['AVG'+q[0]]})
                });
            }(q));
        }
        drawBarChart('drgFeeCompChart'+calType, drgCode+'不同区间内病例次均费用对比图', fiveAvgFee.map(function(v){return v[1]}), data.map(function(v){return v.ddesc}), seriesData);


        var seriesDataStack = [];
        for (var i = 0; i < fiveAvgFee.length; i++) {
            var q = fiveAvgFee[i];
            //for (var q of fiveAvgFee) {
            (function(q){
                seriesDataStack.push({
                    name: q[1],
                    type:'bar',
                    stack: '五大类费用',
                    data: data.map(function(v){return v['AVG'+q[0]]})
                });
            }(q));
        }
        drawBarChart('drgFeeStackChart'+calType, drgCode+'不同区间内病例费用构成及其对比图', fiveAvgFee.map(function(v){return v[1]}), data.map(function(v){return v.ddesc}), seriesDataStack);

        //对比情况表
        //填充columns
        var columns1=[
            {"data": "ddesc","title":"区间内病例类型"},
            {"data": "CASECNT","title":"病例数",
                "render": function(obj, type, full,meta) {
                    if(full.CASECNT==0){
                        return 0 ;
                    }else{
                        var abnomalType; //全部病例 all 未超标 not 超标N以内病例 in 超标N及以上病例 more
                        if(meta.row==0){
                            abnomalType="all";
                        }else if(meta.row==1){
                            abnomalType="more";
                        }else if(meta.row==2){
                            abnomalType="in";
                        }else {
                            abnomalType="not";
                        }
                        return '<a href="javascript:loadFeeDRGCase(\''+sliderValBench+'\',\''+calType+'\',\''+abnomalType+'\',\''+drgCode+'\',\''+full.ddesc+'\')">'+formatNumber(full.CASECNT,0)+'</a>';
                    }
                }
            },
            {"data": "AVGFEE","title":"次均费用"},
            {"data": "AVGDAYS","title":"平均住院日"},
            {"data": "AVGDRUGFEE","title":"次均药品费用"},
            {"data": "DRUGRATIO","title":"药品费用占比"},
            {"data": "AVGMATERFEE","title":"次均耗材费用"},
            {"data": "MATERRATIO","title":"耗材费用占比"},
            {"data": "AVGMEDFEE","title":"次均医疗费用"},
            {"data": "AVGNURSFEE","title":"次均护理费用"},
            {"data": "AVGMANAGEFEE","title":"次均管理费用"},
            {"data": "AVGTECHFEE","title":"次均医技费用"},
            {"data": "AVGDRUGMATERFEE","title":"次均药品耗材费用"},
            {"data": "OPER","title":"操作",
                "render": function(obj, type, full,meta) {
                    if(full.CASECNT==0){
                        return '';
                    } else {
                        var data = JSON.stringify(full).replace(/"/g,'&quot;');
                        return '<a href="javascript:feeStruc(\''+data+'\')">费用构成</a>';
                    }
                }
            }
        ];
        $("#"+tabId+" #caseFeeAllRangTable"+calType).dataTableBasic(columns1,data,paramsDataTables);

        if (calType===2 && isFirst){
            $('#bzcRang').removeClass("active");
            isFirst = false;
        }
    }
});

/**
 * 费用构成
 * @param data
 */
function feeStruc(data){
    var data = JSON.parse(data);

    $('#'+tabId+' #feeStrucModal').modal({
        keyboard: false
    })
    var tableData = [
        {ddesc:'医疗费用', value: data.AVGMEDFEE, stdValue: data.STDMEDFEE},
        {ddesc:'护理费用', value: data.AVGNURSFEE, stdValue: data.STDNURSFEE},
        {ddesc:'管理费用', value: data.AVGMANAGEFEE, stdValue: data.STDMANAGEFEE},
        {ddesc:'医技费用', value: data.AVGTECHFEE, stdValue: data.STDTECHFEE},
        {ddesc:'药品耗材费用', value: data.AVGDRUGMATERFEE, stdValue: data.STDDRUGFEE},
        {ddesc:'合计（次均费用）', ccode: 'all', value: data.AVGFEE, stdValue: data.STDFEE}
    ];
    var paramsDataTables={searching:false,lengthChange:false,ordering:false,stateSave:true,info:false,paging:false,dom: '<"top">t<"bottom"><"clear">'};
    var columns = [
        {"data": "ddesc","title":"费用类别"},
        {"data": "value","title":"本期值",
            "render": function(obj, type, full) {
                if (full.value > full.stdValue){
                    return '<span class="text-danger" title="超标">'+full.value+'</span>';
                } else {
                    return '<span>'+full.value+'</span>';

                }
            }
        },
        {"data": "valueRatio","title":"本期值占比（%）",
            "render": function(obj, type, full) {
                return (full.value*100/tableData[5].value).toFixed(2);
            }
        },
        {"data": "stdValue","title":"标杆值"},
        {"data": "stdValueRatio","title":"标杆值占比（%）",
            "render": function(obj, type, full) {
                return (full.stdValue*100/tableData[5].stdValue).toFixed(2);
            }
        }
    ];


    //饼图
    var feeEchartData = tableData.filter(function (v) {return v.ccode!=='all'}).map(function(v){
        return {
            name : v.ddesc,
            value : v.value
        };
    });

    setTimeout(function(){
        pieCharts($('#'+tabId+' #feeStrucChart'),feeEchartData ,'费用构成图图', '');
        $('#'+tabId+' #feeStrucTable').dataTableBasic(columns,tableData,paramsDataTables) ;
    },400);
}

//病例分布表的病例数链接
//sliderValBenchLater 超标系数值,compareType:划分类型 1是标杆法区间划分 2是标差法区间划分
//compareObj 指标项(如平均住院日) ,abnomalType 区间类型  全部病例 all 未超标 not 超标N以内病例 in 超标N及以上病例 more
//dimensionType 维度类型（科室/主诊组）,dimensionCode 维度代码
function loadFeeDRGCase(sliderValBenchLater,compareType,abnomalType,drgCode,desc){
    var param = jQuery.extend(true,{},paramTabPage[tabId]);
    var paramNew= JSON.parse(JSON.stringify(param));
    if (compareType == 1) {
        paramNew.type2 = 1+sliderValBenchLater/100; //超标比例
    } else {
        paramNew.type2 = sliderValBenchLater; //超标比例
    }
    paramNew.compareType=compareType;
    paramNew.quotaCode='AvgFee';
    paramNew.type3=abnomalType;
    paramNew.pardrgCode = drgCode;
    var destUrl = '/pages/yizheng/fenxi/feeAnalysisCase.jsp';//目标页面的url
    var destPageTitle = desc + '|病例明细';//目标页面的title
    var destPageId = drgCode + abnomalType + 'feeAnalysisCase';//目标页面的ID
    openTab(destUrl, destPageTitle,destPageId,destPageId,paramNew);
}
